<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@ include file="../../header.jsp" %>
</head>

<fieldset i="">

<body>

 <form id="formAdd" class="layui-form">
 
 <div class="layui-form-item">
     <label class="layui-form-label">课程编号</label>
        <div class="layui-input-block">
        <input type= "text" name="courseId" placeholder="请输入课程编号" class="layui-input" style="width: 150px;"></input>
        </div>
 </div>
 
<div class="layui-form-item">
   <label class ="layui-form-label">课程名称</label>
   <div class="layui-input-block">
   <input type="text" name="courseName" placeholder="请输入课程名称" class="layui-input" style="width:150px">
   
   </div>
   
</div>
<div class="layui-form-item">
   <label class ="layui-form-label">上课时间</label>
   <div class="layui-input-block">
   <input type="text" name="time"  placeholder="请输入上课时间" class="layui-input" style="width:150px">
   
   </div>
  </div> 
<div class="layui-form-item">
   <label class ="layui-form-label">学分绩点</label>
   <div class="layui-input-block">
   <input type="text" name="gradePoint"  placeholder="请输入学分绩点" class="layui-input" style="width:150px">
   
   </div>
  </div> 

<div class="layui-form-item">
   <label class ="layui-form-label">授课教师工号</label>
   <div class="layui-input-block">
   <input type="text" name="teacherId"  placeholder="请输入授课教师工号" class="layui-input" style="width:150px">
   
   </div>
  </div> 
   







  <div class="layui-form-itme">
   <div class="layui-input-block">
        <input  type="hidden" id="selectId" value = "查询" onclick="select1()" style="width:80px"  class="layui-btn"></input>
   <input type="button" name ="action" value="添加" lay-submit lay-filter="add" class="layui-btn"></input>
  <input type="javascript:;"  class="layui-btn" onclick="close()" value="关闭" style="width:80px" ></input>
  <button type="reset"  title="重置"  class="layui-btn">重置</button>
   </div>
</div>
 </form>

</body>

</fieldset>
<script src="../../static/js/base.js"></script>
<script type="text/javascript">




function refresh(){
	 $("#selectId").click();	
	}



formSubmit("/StudentMangers/CourseServlet","submit(add)","text",function(data){
		
	if (data == "1") {
								
					layer.msg("添加成功",close)				
				} else if (data == "0") {
					layer.msg("添加失败,该学号已经存在");
				} else {
					layer.msg("添加失败");
				}
	
	
	
			})
			
function close(){
	var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
    parent.layer.close(index);//关闭窗口
}	

refresh();
</script>
</html>